home *** CD-ROM | disk | FTP | other *** search
Oberon Text | 1995-05-08 | 2.4 KB | 68 lines | [TEXT/.Ob4] |
- Syntax10.Scn.Fnt
- FoldElems
- Syntax10.Scn.Fnt
- (*---------------------------------------------------------------
- The Oberon System is designed to work with two tracks of viewers. This causes the
- viewer size to become rather small on 15" monitors. Module Screen provides a
- convenient way to switch between a two track and a one track display in which
- the viewers are larger.
- Screen.OneTrack
- makes the whole screen a single track with the Log viewer on the bottom.
- Screen.TwoTracks
- switches back to the familiar Oberon screen with a user track and a system track.
- ---------------------------------------------------------------*)
- Syntax10i.Scn.Fnt
- StampElems
- Alloc
- 8 May 95
- Syntax10b.Scn.Fnt
- Documentation
- MODULE Screen; (*HM
- (*Needs Log.Menu.Text!*)
- IMPORT Display, Files, Viewers, TextFrames, Oberon, Texts, MenuViewers;
- VAR neutralize: Oberon.ControlMsg;
- PROCEDURE HandleLog(F: Display.Frame; VAR M: Display.FrameMsg);
- VAR ch: CHAR; R: Texts.Reader; org: LONGINT;
- BEGIN
- TextFrames.Handle(F, M);
- IF M IS TextFrames.UpdateMsg THEN
- WITH M: TextFrames.UpdateMsg DO
- IF (M.text = Oberon.Log) & (M.id = TextFrames.insert) THEN
- WITH F: TextFrames.Frame DO
- WHILE F.text.len > TextFrames.Pos(F, F.X + F.W, F.Y) DO
- Texts.OpenReader(R, F.text, F.org);
- REPEAT Texts.Read(R, ch) UNTIL R.eot OR (ch = 0DX);
- TextFrames.Show(F, Texts.Pos(R))
- END
- END
- END
- END
- END
- END HandleLog;
- PROCEDURE OneTrack*;
- VAR v: MenuViewers.Viewer; v0: Viewers.Viewer; t: Texts.Text; buf: Texts.Buffer; menu: TextFrames.Frame;
- BEGIN
- v0 := Viewers.This(0, 0);
- IF v0.W < Display.Width THEN
- Viewers.Broadcast(neutralize);
- Display.ReplConst(Display.black, 0, 0, Display.Width, Display.Height, Display.replace);
- Oberon.OpenTrack(0, Display.Width);
- v := MenuViewers.New(
- TextFrames.NewMenu("System.Log", "^Screen.Menu.Text"),
- TextFrames.NewText(Oberon.Log, 0),
- TextFrames.menuH,
- 0, TextFrames.menuH + 50);
- v.dsc.next.handle := HandleLog
- END OneTrack;
- PROCEDURE TwoTracks*;
- VAR v, v1: Viewers.Viewer;
- BEGIN
- v := Viewers.This(0, 0);
- IF v.W = Display.Width THEN
- Viewers.Broadcast(neutralize);
- REPEAT v1 := Viewers.Next(v); Viewers.Close(v); v := v1 UNTIL v.state <= 1
- END TwoTracks;
- BEGIN
- neutralize.id := Oberon.neutralize
- END Screen.OneTrack
-